<?php
/**
 * Created by PhpStorm.
 * User: huangj11
 * Date: 2020/9/10
 * Time: 16:29
 */

namespace business\search\services;

use business\search\models\SearchPriorityCategoryModel;

class SearchPriorityCategoryService
{
    
    public function getPriorityCategoryBySupplierId($supplierId)
    {
        $model = SearchPriorityCategoryModel::find()
            ->where(['supplier_id' => $supplierId])
            ->limit(1)
            ->one();
        return $model && $model->category_code ? explode(',', $model->category_code) : [];
    }
}